fix: project submodule detection does not work for worktrees
authorPatrick Bader <patrick.bader@thingos.io>
Mon, 4 Mar 2024 15:14:25 +0000 (16:14 +0100)
committerDmitry Gutov <dmitry@gutov.dev>
Fri, 15 Mar 2024 02:26:02 +0000 (04:26 +0200)
lisp/progmodes/project.el

index a7c164f585724239948a374689ddfcb7d3ee9d80..7103b36a8923bcb68670984272d349cb70fef69a 100644 (file)
@@ -602,7 +602,7 @@ See `project-vc-extra-root-markers' for the marker value format.")
         (goto-char (point-min))
         ;; Kind of a hack to distinguish a submodule from
         ;; other cases of .git files pointing elsewhere.
-        (looking-at "gitdir: [./]+/\\.git/modules/"))
+        (looking-at "gitdir: .+/\\.git/\\(worktrees/.*\\)?modules/"))
       t)
      (t nil))))